#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int numJewelsInStones(string jewels, string stones) {
        set<char> storage;
        for (auto& c : jewels)
        {
            storage.insert(c);
        }
        int res = 0;
        for (auto& c : stones)
        {
            if (storage.find(c) != storage.end())
                ++res;
        }
        return res;
    }
};